[OFFLINE CONTENT]
Comment: Win32 Application Setup Project
Set Persistent Variable B to 85MB
Set Variable MYAH_DISABLE_VISTA_RESTART_MANAGER to FALSE
Set Variable MYAH_DISABLE_ROLLBACK to FALSE
Set Variable NATIVE_ROLLBACK to TRUE
Set Variable NATIVE_OVERWRITE_OLDER to FALSE
Set Variable NATIVE_OVERWRITE to PROMPT
Set Variable NATIVE_ERROR to PROMPT
Set Variable DELAYUNTIL_APPLYCHANGES to FALSE
Set Variable SILENT to FALSE
Set Variable SAVEDATA to FALSE
Set Persistent Variable MYAHLOGO to 
Set Variable MYAH_TIMEOUT to 0
Set Variable MYAH_COMPRESS_INSTALLER_CACHE to TRUE
Set Variable LOADOLDDATA to FALSE
Set Persistent Variable MYAHLOGO to True
Set Variable ABORTONERROR to TRUE
[OFFLINE CONTENT]
 
[DEFINE REGION: Application Updates]
Include Script: updates
[END REGION]
 
[DEFINE REGION: Check Application Requirements]
Get System Setting Windows XP into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Windows XP.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
[END REGION]
 
[DEFINE REGION: Check/Install Application Pre-Requisites]
 
[DEFINE REGION: Check Application Pre-Requisites]
Comment: Check setup pre-requisites
Set Variable PREREQ to FALSE
Set Variable PRELIST to 
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Previous Version Uninstallation
end
Include Script: checknet4aip_client_x86
Include Script: checknet4aip_x86
[compiler end]
[END REGION]
 
[DEFINE REGION: Install Application Pre-Requisites]
Comment: Install setup pre-requisites
if Variable PREREQ not Equals FALSE
  Display Dialog: prereq, wait for dialog to return (modal)
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
  Display Dialog: progressprereq, use as progress dialog (non-modal)
  [compiler if Variable BUILDMODE not Equals PATCH]
  if Variable NEEDSUPGRADE Equals TRUE
    Set Variable REMOVEOLD to 
    Set Variable ERROROLD to 
    Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
    if Variable REMOVEOLD Equals ERROR
      MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
      Terminate Installation
    end
    if Variable REMOVEOLD Equals REBOOT
      MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
      if Variable REBOOTNOW Equals OK
        Reboot Computer and Resume Setup
      else
        Terminate Installation
      end
    end
    Set Variable MAINTENANCE to FALSE
  end
  [DEFINE WEB MEDIA Microsoft .NET Framework Client 4]
  Include Script: setupnet4aip_client_x86
  [DEFINE WEB MEDIA Microsoft .NET Framework 4]
  Include Script: setupnet4aip_x86
  [compiler end]
  Hide Dialog
end
[END REGION]
 
[END REGION]
 
[DEFINE REGION: Define Setup Globals]
Comment: Define Setup Components
Define Component: Opkey
Define Component: OpkeyAgent
 
Comment: Initialize Setup Globals
Get System Setting Windows NT Kernel (NT4, 2000, XP, 2003, Vista, 2008, 7, 2008 R2, 8, Server 8) into ISNT
Get Common Folder Location System->Application Data Directory into ALLAPPDATA
Get Folder Location System->Application Data Directory into MYAPPDATA
Get Folder Location System->Application Data Directory into MYAPPDATA
Get Folder Location System->Program Files Directory into PROGRAMFILES
Get Common Folder Location System->Program Files Directory into COMMONFILES
Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
if Variable SHORTCUTFILESALL Equals 
  Set Variable SHORTCUTFILESALL to $SHORTCUTFILES$
end
Get Folder Location System->Desktop Directory into DESKTOPDIR
Get Folder Location System->Windows Directory into WINDIR
Get Folder Location System->System Directory into WINSYSDIR
Get Folder Location Taskbar->Quick Launch Directory into QUICKLAUNCHDIR
Get Folder Location WWW->WWWRoot into WWWROOTDIR
[END REGION]
 
[DEFINE REGION: Setup User Interview]
if Variable MAINTENANCE Equals TRUE
  GoTo Label: Maintenance
else
  [compiler if Variable BUILDMODE not Equals PATCH]
  Comment: First Time Install
  Set Variable TARGETDIR to $PROGRAMFILES$\
  Set Variable STARTMENU to $TITLE$
  [compiler end]
end
 
label: Welcome Dialog
Display Dialog: welcome, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
  GoTo Label: Main Install
end
[compiler if Variable BUILDMODE not Equals PATCH]
label: License Check
Display Dialog: licensecheck, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Welcome Dialog
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: ReadMe Information
Comment: Display Dialog: readme, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: License Check
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: User Registration
Comment: Display Dialog: registration, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: ReadMe Information
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Setup Type
Comment: Display Dialog: setuptype, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: User Registration
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
Comment: TO-DO: Customize your minimum setup here
if Variable MINIMUM Equals TRUE
  Deselect Component: OpkeyAgent
  Deselect Component: Opkey
else
  if Variable COMPLETE Equals TRUE
    Select Component: OpkeyAgent
    Select Component: Opkey
  end
end
label: Custom Setup
Display Dialog: componentstree (if variable PERSONALIZED is TRUE), wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Setup Type
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Destination Directory
Display Dialog: destination, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Custom Setup
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Start Menu
Display Dialog: startmenu, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Destination Directory
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
[compiler end]
label: Start Installation
Set Variable test to Preparing Installation
Display Dialog: startinstallation, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  [compiler if Variable BUILDMODE not Equals PATCH]
  GoTo Label: Start Menu
  [compiler else]
  GoTo Label: Welcome Dialog
  [compiler end]
else
  GoTo Label: Main Install
end
 
label: Maintenance
Set Variable test to preparing customisation
Comment: Maintenance Install/Uninstall
wizard loop
Display Dialog: maintenance, wait for dialog to return (modal)
Display Dialog: componentstree (if variable MODIFY is TRUE), wait for dialog to return (modal)
Display Dialog: startinstallation, wait for dialog to return (modal)
end
[END REGION]
 
[DEFINE REGION: Process (Un)Installation]
label: Main Install
Comment: Exit Setup if Wizard Loop cancelled
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
 
Comment: Prepare to install
Set Variable test to Preparing Installation
Set Variable PROGRESSTEXT to Installing $TITLE$
Set Variable SUCCESS to 
Set Variable LASTERROR to 
if Variable ALLUSERS Equals TRUE
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\$STARTMENU$
else
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILES$\$STARTMENU$
end
Display Dialog: progress, use as progress dialog (non-modal)
 
Comment: Modify Target System
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
  Comment: Uninstall product
  Comment: TO-DO: Insert any additional uninstall commands here
  Set Variable PROGRESSTEXT to Preparing Unistallation
  Comment: Run Program $SUPPORTDIR$\ExitApplication.exe opkey (WAIT, get result into variable SUCCESS)
  if Variable SUCCESS Equals 5
    Terminate Installation
  else
    Apply Uninstall (get result into variable SUCCESS)
    if Variable SUCCESS not Equals ERROR
      if Variable SUCCESS not Equals CANCEL
      end
    end
    Set Variable PROGRESS to 100
  end
else
  [END REGION]
  [DEFINE REGION: Perform First Time or Maintenance Installation]
  Run Program $SUPPORTDIR$\ExitApplication.exe opkey (WAIT, get result into variable SUCCESS)
  if Variable SUCCESS Equals 5
    Terminate Installation
  end
  Comment: Install/Re-Install product
  Create Shortcut $SHORTCUTFOLDER$\Uninstall Opkey to $UNINSTALLLINK$
  [OFFLINE CONTENT]
  Create Shortcut $SHORTCUTFOLDER$\Opkey Update to $UNINSTALLLINK$
  Create Shortcut $DESKTOPDIR$\OpKey to $TARGETDIR$\CresTech\Opkey\Assembly\Opkey.exe
  Create Shortcut $SHORTCUTFOLDER$\OpKey to $TARGETDIR$\CresTech\Opkey\Assembly\Opkey.exe
  Install Files E:\PersonalRelease\BuildDll\DevExpress.BonusSkins.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.Charts.v11.2.Core.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.Data.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.PivotGrid.v11.2.Core.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.Printing.v11.2.Core.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.RichEdit.v11.2.Core.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.Utils.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraBars.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraCharts.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraCharts.v11.2.UI.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraEditors.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraGrid.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraLayout.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraNavBar.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraPivotGrid.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraPrinting.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraReports.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraRichEdit.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraRichEdit.v11.2.Extensions.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraTreeList.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraVerticalGrid.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\DevExpress.XtraWizard.v11.2.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\LogicNP.CryptoLicensing.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\MySql.Data.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\System.Data.SQLite.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files E:\PersonalRelease\BuildDll\TextFormatConvertor.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  if Variable ALLUSERS not Equals TRUE
  else
  end
  [OFFLINE CONTENT]
  if Variable SELECTED Equals TRUE
  end
  Install Files D:\Release\Config\Config Selenium\CONFIG\Icon\folder_opkey.ico to $TARGETDIR$\CresTech\Opkey
  Install Files D:\Opkey Data\Opkey Build Data\RefractoredOpkey\AgentWSServer\bin\x86\Debug\CrystalDecisions.CrystalReports.Engine.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  Install Files D:\Opkey Data\Opkey Build Data\RefractoredOpkey\AgentWSServer\bin\x86\Debug\CrystalDecisions.Shared.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  [OFFLINE CONTENT]
  Get Component OpkeyAgent Selection State into Variable SELECTED
  if Variable SELECTED Equals TRUE
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.UI.WinForms.exe to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\OpKey.exe to $TARGETDIR$\CresTech\Opkey\Assembly
  end
  [OFFLINE CONTENT]
  Get Component Opkey Selection State into Variable SELECTED
  if Variable SELECTED Equals TRUE
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Util.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.UI.WinForms.Snipper.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Data.BaseSQL.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Data.ConstructsDATA.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Data.DBManager.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Data.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Data.ExecData.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Data.MySQL.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Data.SQLite.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Execution.Client.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.ExecutionSystem.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Licencing.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Messaging.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Reports.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.SystemPlugin.dll to $TARGETDIR$\CresTech\Opkey\Assembly
    Install Files D:\InstallAware\Team\ObfuscatedDll\CresTech.OpKey.Core.dll to $TARGETDIR$\CresTech\Opkey\Assembly
  end
  Comment: TO-DO: Insert any additional install commands here
  [compiler if Variable BUILDMODE Equals PATCH]
  Apply Patch (get result into variable SUCCESS)
  [compiler else]
  if Variable ADVERTISE Equals TRUE
    Apply Advertised (get result into variable SUCCESS)
  else
    Create Folder $TARGETDIR$\CresTech
    Create Folder $TARGETDIR$\CresTech\Opkey
    Create Folder $TARGETDIR$\CresTech\Opkey\Assembly
    Create Folder $ALLAPPDATA$\CresTech
    Create Folder $ALLAPPDATA$\CresTech\Opkey
    Create File Type Opkey File with extensions .OKPROJ and associate with program $TARGETDIR$\CresTech\Opkey\Assembly\OpKey.exe
    Apply Install (get result into variable SUCCESS)
    Comment: Write into Text File $ALLAPPDATA$\CresTech\Opkey\Agent\DataPath.txt from Value $ALLAPPDATA$\CresTech\Opkey\Agent\AgentData (at start of file)
  end
  [compiler end]
  Set Variable PROGRESS to 100
end
[END REGION]
[END REGION]
 
[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
  if Variable REBOOTCOMPUTER Equals TRUE
    if Variable SUCCESS Equals REBOOT
      Reboot Computer
    end
  end
  if Variable RUNAPP Equals TRUE
    if Variable REMOVE Equals FALSE
      if Variable SUCCESS Equals COMPLETE
        Run Program $TARGETDIR$\CresTech\Opkey\Assembly\ExitApplication.exe opkey (WAIT)
        Run Program $TARGETDIR$\CresTech\Opkey\Assembly\Opkey.exe 
        Comment: TO-DO: Insert command that starts your application here
      end
    end
  end
end
[END REGION]
 
